package com.edt.ichannel.utils;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class PageUtils {
	/**
	 * 发送数据
	 * @param content
	 * @throws IOException
	 */
	public static void sendMsg(String content, HttpServletResponse response) throws IOException {
        response.setCharacterEncoding("UTF-8");      
        response.getWriter().write(content);
        response.getWriter().flush();
        response.getWriter().close();
    }

	/**
	 * 发送数据 JSON类型
	 * @param content
	 * @param response
	 * @throws IOException
	 */
	public static void sendMsgJson(String content, HttpServletResponse response) throws IOException {
		response.setContentType("application/json");
		response.setCharacterEncoding("UTF-8");      
		response.getWriter().write(content);
		response.getWriter().flush();
		response.getWriter().close();
	}


}
